import request from '@/utils/request'

// 查询登录日志列表
export function list(query) {
  return request({
    url: '/training/sportsman/list',
    method: 'get',
    params: query
  })
}

// 删除登录日志
export function delLogininfor(infoId) {
  return request({
    url: '/monitor/logininfor/' + infoId,
    method: 'delete'
  })
}

// 清空登录日志
export function cleanLogininfor() {
  return request({
    url: '/monitor/logininfor/clean',
    method: 'delete'
  })
}

// 导出登录日志
export function exportLogininfor(query) {
  return request({
    url: '/monitor/logininfor/export',
    method: 'get',
    params: query
  })
}
// // 新增用户
export function addUser1(data) {
  return request({
    url: '/app/sportsman/add',
    method: 'post',
    data: data
  })
}
export function addPhysical2(data) {
  return request({
    url: '/app/sportsman/addSportsmanPhysicalQuality',
    method: 'post',
    data: data
  })
}


// 修改用户
export function updateUser1(data) {
  return request({
    url: '/app/sportsman/edit',
    method: 'post',
    data: data
  })
}
export function updatePhysical2(data) {
  return request({
    url: '/app/sportsman/editSportsmanPhysicalQuality',
    method: 'post',
    data: data
  })
}
// ========================================首页===================================
// 今日训练内容

export function todaytraining(data) {
  return request({
    url: '/app/index/todayTrainingContent',
    method: 'get',
    
  })
}
export function traing(data) {
  return request({
    url: '/app/index/checkOnWorkAttendance?type='+data.naturalYearId+"&weekPlanStartTime="+data.weekPlanStartTime+"&weekPlanEndTime="+data.weekPlanEndTime,
    method: 'get',
    data: data
  })
}

// 年度阶段目标完成1
export function target(data) {
  return request({
    url: '/app/index/annualTargetCompletionRate',
    method: 'get',
    data: data
  })
}
// 阶段目标完成情况(年度目标) 周形统计2  这个接口是下面的数据吗
export function totalweek(data) {
  return request({
    url: "/app/index/checkOnWorkAttendancePopulationStatistics",
    method: 'get',
    params: data
  })
}
// 阶段目标完成情况(年度目标) 周形统计3
export function WeekTypeStatistic(data) {
  return request({
  url: '/app/index/checkOnWorkAttendanceWeekTypeStatistics',
  method: 'get',
  params: data
  })
  }
// 年度训练地点

export function Traininglocation(data) {
  return request({
    url: '/app/index/trainingArea',
    method: 'get',
    params: data
  })
}

export function showtimes(data) {
  return request({
    url: '/app/index/trainingProgramSchedule',
    method: 'get',
    data: data
  })
}
// 首页的最好成绩接口
export function getTrainingResults(data) {
  return request({
  url: '/app/index/trainingResults',
  method: 'get',
  params: data
  })
  }
  
  // 首页的 各训练科目完成进度的表格
  export function getTrainingProgramList(data) {
  return request({
  url: '/app/index/trainingProgramScheduleTable',
  method: 'get',
  params: data
  })
  }
// 首页受伤统计详情
export function mantotal(data) {
  return request({
    url: '/app/index/getCountByDay',
    method: 'get',
    params: data
  })
}
// 年度目标的时间
export function datatime(data) {
  return request({
    url: '/app/annualPlan/list',
    method: 'get',
    data: data
  })
}
//年度下拉
export function selectime(data) {
  return request({
    url: '/app/annualPlan/naturalYearList',
    method: 'get',
    data: data
  })
}
// =================设置年训练项目目标=============
export function selecterter(data) {
  return request({
    url: '/app/annualPlan/add',
    method: 'post',
    data: data
  })
}
export function selecterteredit(data) {
  return request({
    url: '/app/annualPlan/edit',
    method: 'post',
    data: data
  })
}
export function selectlist(data) {
  return request({
    url: '/app/annualPlan/list',
    method: 'get',
    data: data
  })
}
// 新增年
export function addyeal(data) {
  return request({
    url: '/app/annualPlan/annualProject/add',
    method: 'post',
    data: data
  })
}

// =============运动员管理部分==============
// 获取运动员详细信息
export function proportiontatals(sportsManId) {
  return request({
    url: '/app/sportsman/getInfo/'+sportsManId,
    method: 'get',
    
  })
}
// 号位占比
export function proportion(data) {
  return request({
    url: '/app/sportsman/positionRatio',
    method: 'post',
    data: data
  })
}
// 不同艇支训练占比
export function boattotal(data) {
  return request({
    url: '/app/sportsman/boatFrequency',
    method: 'post',
    data: data
  })
}
// 不同艇支划行训练量
export function trainingBoatType(data) {
  return request({
    url: '/app/sportsman/trainingBoatType',
    method: 'get',
    params: data
  })
}
// 不同舰支划行时长
export function BoatTypetime(data) {
  return request({
    url: '/app/sportsman/classHourBoatType',
    method: 'get',
    params: data
  })
}

export function sportmanoarType(data) {
  return request({
    url: '/app/sportsman/oarType',
    method: 'get',
    params: data
  })
}
// 运动员身体素质最优最新
export function traingPhysical(sportsManId) {
  return request({
    url: '/app/sportsman/getOptimalSportsmanPhysicalQualityInfo/'+sportsManId,
    method: 'get',
   
  })
}

export function besttraingPhysical(sportsManId) {
  return request({
    url: '/app/sportsman/getSportsmanPhysicalQualityInfo/'+sportsManId,
    method: 'get',
   
  })
}
// 水上专项最好成绩折线图
export function bestwater(data) {
  return request({
    url: '/app/sportsman/bestResultSpecialProject',
    method: 'get',
    params: data
  })
}
// 最佳拍档(成绩)
export function Partner(data) {
  return request({
    
    url: '/app/sportsman/partnerCooperationResult',
    method: 'get',
    params: data
  })
}
// 最佳拍档合作次数
export function cooperation(data) {
  return request({
    url: '/app/sportsman/partnerCooperationTimes',
    method: 'get',
    params: data
  })
}
// 身体素质雷达分析报告
export function radarchart(data) {
  return request({
    url: '/app/sportsman/bodyChart',
    method: 'get',
    params: data
  })
}
// 身体机能功能1
export function enginery(data) {
  return request({
    url: '/app/sportsman/bodyFunctionAnalysis',
    method: 'get',
    params: data
  })
}
// pk
// 水上专项最好成绩折线图
export function matchbetter(data) {
  return request({
    url: '/training/sportsmanMatch/queryNameList',
    method: 'get',
    params: data
  })
}

export function traingpk(data) {
  return request({
    url: '/app/pk/basicPropertiesPK',
    method: 'get',
    params: data
  })
}
export function PhysicalQualityPK(data) {
  return request({
    url: '/app/pk/sportsmanPhysicalQualityPK',
    method: 'get',
    params: data
  })
}

export function race(data) {
  return request({
    url: '/app/sportsman/resultsList',
    method: 'get',
    params: data
  })
}


// 周与周训练量/(时长)对比
export function weekTrainingCompletio(data) {
  return request({
    url: '/app/sportsman/weekTrainingCompletion',
    method: 'get',
    params: data
  })
}

export function weekDate(data) {
  return request({
    url: '/app/weekPlan/naturalYearList',
    method: 'get',
    params: data
    
  })
}

// 受伤部位修复时间
export function injuryHoursCount(data) {
  return request({
    url: '/app/sportsman/injuryHoursCount',
    method: 'get',
    params: data
  })
}
// 受伤次数
export function injuryCount(data) {
  return request({
    url: '/app/sportsman/injuryCount',
    method: 'get',
    params: data
  })
}
// 过敏史
export function allergyList(data) {
  return request({
    url: '/app/sportsman/allergyList',
    method: 'get',
    params: data
  })
}

// 受伤史
export function injuryList(data) {
  return request({
    url: '/app/sportsman/injuryList',
    method: 'get',
    params: data
  })
}

// 生病史
export function illnessList(data) {
  return request({
    url: '/app/sportsman/illnessList',
    method: 'get',
    params: data
  })
}
// 运动员比赛成绩

export function matchList(data) {
  return request({
    url: '/app/sportsman/deleteSportsmanMatch',
    method: 'get',
    params: data
  })
}
// ===========================================================周计划
// 周计划当前处于下拉框
export function nowtimes(data) {
  return request({
    url: '/app/annualPlan/naturalYearTree',
    method: 'get',
    params: data
  })
}
// 获取本周信息
export function annualweek(data) {
  return request({
    url: '/app/weekPlan/getInfo',
    method: 'get',
    params: data
  })
}
// 本周目标
export function targetweek(data) {
  return request({
    url: '/app/weekPlan/trainingDay/listWeek',
    method: 'get',
    params: data
  })
}
// 周计划弹框
export function plansweek(data) {
  return request({
    url: '/app/annualPlan/totalLevelList',
    method: 'get',
    params: data
  })
}
// 周计划弹框创建
export function establishweek(data) {
  return request({
    url: '/app/weekPlan/trainingDay/add',
    method: 'post',
    data: data
  })
}
// 本周计划
export function thisdayweek(data) {
  return request({
    url: '/app/weekPlan/getWeekDetails',
    method: 'get',
    params: data
  })
}
// 本周目标
export function thisdayweektarget(data) {
  return request({
    url: '/app/weekPlan/trainingDay/listWeek',
    method: 'get',
    params: data
  })
}